1. Field of the Invention
The present invention, in general, relates to error handling and recovery for disk storage media and in particular to error recovery due to physical defects of the storage media.
2. Description of the Related Art
Disk storage devices are used to store data in computer systems. The majority of contemporary disk storage includes some type of mechanism for handling error conditions associated with data recordings on the disk. One type of error condition occurs when disk media in a block is deemed to be corrupted. A mechanism termed Bad Block Relocation (hereafter BBR) is used to relocate the bad block to a reserved replacement sector on the disk. This is achieved by maintaining a relocation map called BBR Directory (hereafter BBRD). This map pairs locations; so when the disk block in one location is deemed defective it is removed to the paired location.
This approach works well so long as the block that is being relocated does not contain the BBRD. If it does contain the BBRD, the disk is deemed defective and future input/output (I/0) activities with the disk is terminated. This is done by marking the disk completely bad, thereby avoiding any future I/Os to it until corrective action is taken. This approach has several drawbacks which makes it unacceptable. For example, it is possible that the rest of the disk is in good state except for the newly detected bad block or blocks. If this is the case, marking the disk completely bad is wasteful. In addition, corrective action usually requires migrating data from the allegedly defective disk to a different disk which leads to considerable down time.
In view of the above, it would be desirable, therefore, to provide a mechanism that relocates BBRD due to error associated with defect of the physical media. It would also, be desirable to provide a mechanism that marks the disk bad only if the entire disk or most of it is deemed defective and not when only part of it is.